<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0" prefix="dsp" %>
<dsp:page>
	<dsp:importbean bean="/atg/commerce/order/ShoppingCartModifier"/>
	<dsp:getvalueof var="order" bean="ShoppingCartModifier.shoppingCart.current"/>
	<dsp:getvalueof var="shippingGrouop" bean="ShoppingCartModifier.shoppingCart.current.shippingGroups[0]"/>
	<dsp:getvalueof var="paymentGrouop" bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0]"/>
	<dsp:importbean bean="/atg/dynamo/droplet/ForEach"/>
	<dsp:importbean bean="/atg/commerce/order/purchase/CommitOrderFormHandler"/>
	<dsp:importbean bean="/atg/dynamo/droplet/ErrorMessageForEach" />

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="style.jspf" %>
<title>demo</title>
</head>	
	<body>
		<div id="wrap" class="clear-block">
          <dsp:form>
            <div class="checkout">
                <h3>Checkout - <span class="name">Order Review</span></h3>
                
									<dsp:droplet name="ErrorMessageForEach">
									  <dsp:param bean="ShoppingCartModifier.formExceptions" name="exceptions" />
									  <dsp:param name="propertyNameTable" value="firstName=First Name, address1=ssss, creditCartNumber=11111"/>
									  <dsp:oparam name="output">
									       <div class="error">
									         <dsp:valueof param="message"/>
									       </div>
									  </dsp:oparam>
									</dsp:droplet>

                	<div class="orderSummary">
                    <h4>Please review your order and submit.</h4>
				              <dsp:droplet name="ForEach">
				                 <dsp:param name="array" bean="ShoppingCartModifier.shoppingCart.current.commerceItems"/>
				                 <dsp:param name="elementName" value="commerceItem"/>
				                 <dsp:oparam name="outputStart">
				                    <div class="listBox">
					                    <ul class="head">
					                        <li class="item">Item</li>
					                        <li class="qty">Quantity</li>
					                        <li class="price">Amount</li>
					                    </ul>
				                   </div>
				                 </dsp:oparam>
				                 <dsp:oparam name="output">
				                    <div class="listBox">
					                    <ul>
					                        <li class="item">
					                            <p class="name">
					                              <dsp:a href="productDetail.jsp">
												   								<dsp:param name="pId" param="commerceItem.auxiliaryData.productId"/>
					                               <dsp:valueof param="commerceItem.auxiliaryData.productRef.displayName"></dsp:valueof>
												   							</dsp:a>
					                            </p>
					                            <p>SKU: <span>
												  								<dsp:valueof param="commerceItem.catalogRefId"/>
																			</span></p>
					                        </li>
					                        <li class="qty">
											  						<dsp:valueof param="commerceItem.quantity"/>
																	</li>
					                        <li class="price">
																	 <dsp:valueof param="commerceItem.priceinfo.amount" converter="currency"/>
																	</li>
					                    </ul>
				                   </div>
				                 </dsp:oparam>
				              </dsp:droplet>
											<div class="totalBox">
												<table>
													<tr>
														<td width="85%" class="subTotal">Sub Total</td>
														<td width="15%" class="subTotal"><dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.priceInfo.amount" converter="currency"/></td>
													</tr>
													<tr>
														<td>Tax</td>
														<td ><dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.taxPriceInfo.amount" converter="currency"/></td>
														<!--
														<td>$10.00</td>
														-->
													</tr>
														<dsp:getvalueof var="samount" bean="ShoppingCartModifier.shoppingCart.current.priceInfo.amount"/>
														<dsp:getvalueof var="staxamount" bean="ShoppingCartModifier.shoppingCart.current.taxPriceInfo.amount"/>
													<tr>
														<td class="total">Total</td>
														<td class="total"><dsp:valueof value="${samount+staxamount}" converter="currency"/></td>
													</tr>
												</table>
											</div>
                </div>
                
                <div class="paymentInfo">
                    <h4>Payment Information</h4>
                    <div class="info">
                    	<p class="first"><dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.firstName"/> <dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.lastName"/>, <dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].creditCardType"/> <dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].creditCardNumber"/></p>
                        <p><dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.address1"/></p>
                        <p><dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.city"/>, <dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.state"/> <dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.postalCode"/></p>
                        <p><dsp:valueof bean="ShoppingCartModifier.shoppingCart.current.paymentGroups[0].billingAddress.country"/></p>
                    </div>
                </div>
                
                 <div class="btnBox">
                   <dsp:a href="shoppingCart.jsp" iclass="btn"><span>Cancel</span></dsp:a>
								   <dsp:input bean="CommitOrderFormHandler.commitOrder" type="submit" value="Submit Order" iclass="btn"></dsp:input>
								   <dsp:input bean="CommitOrderFormHandler.orderId" type="hidden" beanvalue="ShoppingCartModifier.shoppingCart.current.id"/>
								   <dsp:input bean="CommitOrderFormHandler.commitOrderSuccessURL" type="hidden" value="orderConfirmation.jsp"/>
								   <dsp:input bean="CommitOrderFormHandler.commitOrderErrorURL" type="hidden" value="chkReview.jsp"/>
								 </div>
                
            </div>
          </dsp:form>
            
		</div>
	</body>
	</dsp:page>
</html>